<template>
    <div id="my-input">
        <input :type="type" :value="value" @input="inputChange" :placeholder="placeholder">
    </div>
</template>

<script>
export default {
    name: 'my-input',
    props: {
        value: '',
        type: {
            type: String,
            required: true,
            default: 'text'
        },
        placeholder: {
            type: String,
            default: '请输入'
        }
    },
    methods:{
        inputChange(e) {
            this.$emit('input', e.target.value)
        }
    },
}
</script>

<style scoped>
</style>